using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerStateInGround : PlayerStateBase
{
    public PlayerStateInGround(Player player, StateMachine stateMachine, string animName) : base(player, stateMachine, animName)
    {

    }
    public override void Enter()
    {
        base.Enter();
    }
    public override void Update()
    {
        base.Update();
        if (rb.velocity.y < 0 && !player.IsWall)
            stateMachine.ChangeState(player.jumpFallState);

        if (input.Player.Jump.WasPressedThisFrame())
            stateMachine.ChangeState(player.jumpUpState);

        if (input.Player.Attack.IsPressed() && !animator.GetBool("Attack"))
            stateMachine.ChangeState(player.baseAttackState);

        if (input.Player.CounterAttack.WasPressedThisFrame())
            stateMachine.ChangeState(player.counterAttackState);
            
        if (input.Player.RangeAttack.WasPressedThisFrame() && skillManager.skillSwordThrow.CanUseSkill())
            stateMachine.ChangeState(player.swordThrowState);
        
    }
    public override void Exit()
    {
        base.Exit();
    }
}
